#!/bin/bash

read name

filename="$name.cpp"

lines="#include <iostream>
using namespace std;
int main(){
    
}"

if [[ ! -e "$filename" ]]; then
    touch "$filename"
    echo "$lines" > "$filename"
else
    echo "File already exists."
fi

vi "+$" "$filename"
